import collections
class Solution(object):
    def maxPoints(self, points):
        """
        :type points: List[List[int]]
        :rtype: int
        """
        line = collections.defaultdict(set)
        length = len(points)
        for i in range(length):
            for j in range(i + 1, length):
                if points[i][0] == points[j][0]:
                    a = 1
                    b = 0
                    c = - points[i][0]
                    line[(a, b, c)].add(tuple(points[i]))
                    line[(a, b, c)].add(tuple(points[j]))
                else:
                    b = -1
                    a = (points[j][1] - points[i][1]) / (points[j][0] - points[i][0])
                    c = points[i][1] - a * points[i][0]
                    line[(a, b, c)].add(tuple(points[i]))
                    line[(a, b, c)].add(tuple(points[j]))
        max_value = 1
        for item in line:
            max_value = max(max_value, len(line[item]))
        print(line)
        return max_value

data = Solution()
# points = [[1,1],[2,2],[3,3]]
# print(data.maxPoints(points))
# points = [[0, 0]]
# print(data.maxPoints(points))
points = [[0,0],[4,5],[7,8],[8,9],[5,6],[3,4],[1,1]]
print(data.maxPoints(points))